<template>
    <div>
        <ItemMy :user-info="userInfo" />
        <div class="container">
            <!-- 兴趣标签 -->
            <taglist :checked="userInfo.hobby.split(',')" />
            <div
                v-for="(temp, index) in itemList"
                :key="index"
                class="profile"
                @click="routerLink(temp.href)"
            >
                <div>{{ temp.title }}</div>
                <div class="name">
                    <img src="@/assets/more-icon.png" alt class="more-icon">
                </div>
            </div>
        </div>
        <p>技术支持：有安米互动</p>
    </div>
</template>
<script>
// item
import ItemMy from '@/components/item/ItemMy';
import taglist from '@/components/tag';
// icon
import avatar from '@/assets/tx.png';
import girl from '@/assets/girl-icon.png';
import boy from '@/assets/boy-icon.png';
// vuex
import { mapGetters } from 'vuex';
export default {
    components: {
        ItemMy,
        taglist
    },
    filters: {
        sex(sex) {
            const sexMap = {
                1: boy,
                2: girl,
                3: '未知'
            };
            return sexMap[sex];
        }
    },
    data() {
        return {
            avatar,
            itemList: [
                { title: '我的资料', href: 'profile' },
                { title: '我的动态', href: 'mydynamic' },
                { title: '我的相册', href: 'myphoto' },
                { title: '密码修改', href: 'ChangePasw' }
            ]
        };
    },
    computed: {
        ...mapGetters(['userInfo'])
    },
    methods: {
        routerLink(href) {
            this.$router.push({ name: href });
        }
    }
};
</script>

<style lang="less" scoped>
.container {
  width: 95%;
  margin: 0 auto;
}
.head-info,
.left-info {
  display: flex;
  justify-content: space-between;
}
.more-info {
  width: 50%;
  box-sizing: border-box;
  padding-left: 15px;
  padding-top: 20px;
}
.left-info {
  width: 50%;
}
.head-img {
  width: 70px;
  height: 70px;
  overflow: hidden;
  border: 1px solid #aaa;
  border-radius: 50px;
}
.head-img .tx {
  width: 100%;
}
.age,
.constell {
  font-size: 0.75rem;
}
.constell {
  margin-left: 9%;
}
.name {
  font-size: 1.5rem;
  padding-right: 10px;
  font-weight: bold;
}
.info-right {
  font-size: 0.7rem;
  color: #666;
}
.edit {
  width: 100%;
  display: flex;
  margin: 0 auto;
}
.tag {
  width: 100%;
}
.words {
  width: 95%;
  margin: 5% 2.5% 0;
  position: relative;
  border-radius: 5px;
  display: inline-block;
  font-size: 0.75rem;
  line-height: 28px;
  background: #6392ea;
  color: #fff;
  &:after {
    content: " ";
    position: absolute;
    top: -11px;
    left: 15px;
    border-bottom: 12px solid #6392ea;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
  }
  .heart {
    width: 16px;
    height: 14px;
    line-height: 14px;
    padding: 7px 15px;
  }
  .words-cont {
    padding: 10px 0;
    letter-spacing: 3px;
    line-height: 20px;
    display: flex;
    justify-content: flex-start;
  }
  &-2 {
    background: #ef8383;
    &::after {
      border-bottom-color: #ef8383;
    }
  }
  &-3 {
    background: #f45050;
    &::after {
      border-bottom-color: #f45050;
    }
  }
}

.profile {
  width: 100%;
  height: 70px;
  line-height: 70px;
  font-size: 1.0625rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  border-bottom: 1px solid #ccc;
}
.title {
  font-size: 18px;
  color: #e06363;
  display: block;
  width: 100%;
}
.copy {
  /* border: 1px solid #ccc; */
  background: #52d1a5;
  height: 25px;
  line-height: 25px;
  padding: 3px 10px;
  border-radius: 10px;
  margin-top: 5px;
  font-size: 0.7rem;
  color: #fff;
}
p {
  text-align: center;
  margin-top: 40%;
  font-size: 0.75rem;
}
</style>
